Skip to content

refactor(storage)!: migrate to TypeScript and match firebase-js-sdk API#8824

Open
russellwheatley wants to merge 116 commits intomainfrom
storage-typescript
Open

refactor(storage)!: migrate to TypeScript and match firebase-js-sdk API#8824
russellwheatley wants to merge 116 commits intomainfrom
storage-typescript

Conversation

@russellwheatley
Copy link
Copy Markdown
Member

@russellwheatley russellwheatley commented Jan 8, 2026

Description

  • First TS migration to completely separate namespaced types from modular. namespaced types live in types/namespaced.ts and are almost identical to previous index.d.ts. This make it a really easy clean up when we switch off namespaced.
  • Matches firebase-js-sdk as close as possible now which includes below noted breaking changes:

Breaking Changes

  • breaking rename StorageReference to Reference to match firebase-js-sdk. See commit
  • breaking remove methods from Reference and put on internal Reference type for modular See commit
  • breaking remove methods from Storage and put on an internal Storage type for modular. See commit
  • breaking Type Reference is now StorageReference. [See commit]
  • breaking rename StorageReference class to Reference. See commit
  • breaking ListOptions updated to match firebase-js-sdk. See commit
  • breaking update ListResult to match firebase-js-sdk. See commit
  • breaking match SettableMetadata, UploadMetadata & FullMetadata. Also using NativeFirebaseError rather than Error. See commit
  • breaking updated TaskState and TaskEvent types to match firebase-js-sdk. See commit
  • breaking remove storage.statics.* types from modular. Need to import individually. See commit
  • breaking Task related API has been moved to match firebase-js-sdk. See commit.
  • breaking refactor!: use ref() instead of refFromUrl like firebase-js-sdk. See commit
  • breaking refactor!: remove toString() modular to match JS SDK. use ref.toString() instead. See commit
  • breaking refactor!: remove child(), use ref() instead to match JS. See commit
  • breaking refactor!: make ListOptions.pageToken nullable like JS SDK. See commit
  • breaking refactor!: update upload api to use UploadMetadata and deprecate md5hash so should use md5Hash See commit

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan


Think react-native-firebase is great? Please consider supporting the project with any of the below:


Note

High Risk
High risk because it introduces breaking API renames (StorageReferenceReference) and reshapes core Storage task/list/ref behaviors and types, which can affect most Storage consumers at compile time and runtime.

Overview
Refactors @react-native-firebase/storage to TypeScript and reorganizes exports around a new types/storage.ts modular surface (with separate types/namespaced.ts kept for backwards compatibility).

Aligns the modular API more closely with the firebase-js-sdk: ref() now supports full gs:///https:// URLs (replacing refFromURL usage), child() and modular toString() helpers are removed in favor of ref(refOrStorage, path) overloads and Reference.toString(), and list option typing/handling is updated to allow nullable fields in modular calls.

Renames the public reference class from StorageReference to Reference, updates task/list internals (StorageTask, StorageListResult) to typed implementations, and adjusts task/error typing to use NativeFirebaseError plus async pause()/resume()/cancel() semantics. CI type-drift checking is extended to include Storage via new compare-types storage-js-sdk.d.ts and packages/storage/config.ts.

Reviewed by Cursor Bugbot for commit 3ee0a27. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-firebase Error Error Apr 10, 2026 2:31pm

Request Review

@github-actions
Copy link
Copy Markdown

Hello 👋, this PR has been opened for more than 14 days with no activity on it.

If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing!

You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Jan 29, 2026
@mikehardy mikehardy removed the Stale label Jan 29, 2026
@russellwheatley
Copy link
Copy Markdown
Member Author

/gemini summary

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

This pull request performs a significant refactor of the storage package to improve alignment with the official firebase-js-sdk. By migrating to TypeScript and adopting a modular API structure, the changes aim to provide a more consistent developer experience while preparing the codebase for future deprecation of the namespaced API. Several breaking changes were introduced to ensure the API surface area matches the web SDK, including renaming key classes and updating method signatures.

Highlights

  • TypeScript Migration: Initiated the migration to TypeScript by separating namespaced types into types/namespaced.ts and aligning the modular API with the firebase-js-sdk.
  • API Alignment: Renamed StorageReference to Reference and refactored various methods (e.g., ref() instead of refFromUrl(), ref() instead of child()) to match the firebase-js-sdk.
  • Breaking Changes: Removed several methods from Reference and Storage classes, moving them to internal types for modularity, and updated ListOptions, ListResult, and task-related types to match the official JS SDK.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Activity
  • Pull request created by russellwheatley.
  • Vercel deployment failed.
  • Automated stale bot warnings posted on Jan 29 and Mar 19.
  • Author requested a summary via /gemini command on Mar 27.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3ee0a27. Configure here.

mikehardy and others added 4 commits April 9, 2026 15:32
this was needed for react-native-macos immediately as it runs on 'latest-stable'
in CI, while react-native was pinned to a prior version so CI kept passing

local builds will fail without this though and do need it
…at still have methods (such as StorageReference) and fire console warning incorrectly
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 10, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants